﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TuongLai_Schools
{
    public partial class frmDanhmuc : Form
    {
        clsSysObject clsObject = new clsSysObject();
        clsCommon objCommon = new clsCommon();

        public frmDanhmuc()
        {
            InitializeComponent();
        }

        private void frmDanhmuc_Load(object sender, EventArgs e)
        {
            GetAll_Object();
           // objCommon.GetForm(new frBuoihoc(), this.panel3);
        }
        private void GetAll_Object()
        {
            gridControl1.DataSource = clsObject.GetAll_Object();
        }
        string chon;
        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            try
            {
                DataRow dtr = gridView1.GetDataRow(e.RowHandle);
                lbDanhmuc.Text = dtr["ObjectName"].ToString().Trim();
                chon = dtr["ObjectNote"].ToString().Trim();
                switch (chon)
                {
                    case "BH":
                        objCommon.GetForm(new frBuoihoc(), this.panel3);
                        break;
                    case "CH":
                        objCommon.GetForm(new frmCaphoc(), this.panel3);
                        break;
                    case "CQL":
                        objCommon.GetForm(new frmCapquanly(), this.panel3);
                        break;
                    case "CTHSG":
                        objCommon.GetForm(new frmCapthihocsinhgioi(), this.panel3);
                        break;
                    case "CT":
                        objCommon.GetForm(new frmCaptruong(), this.panel3);
                        break;
                    case "CSBMI":
                        objCommon.GetForm(new frmChisoBMI(), this.panel3);
                        break;
                    case "CTDGHK":
                        objCommon.GetForm(new frmChitieudanhgiahanhkiem(), this.panel3);
                        break;
                    case "CVDT":
                        objCommon.GetForm(new frmChucvudoanthe(), this.panel3);
                        break;
                    case "CVL":
                        objCommon.GetForm(new frmChucvulop(), this.panel3);
                        break;
                    case "CC":
                        objCommon.GetForm(new frmChuyencan(), this.panel3);
                        break;
                    case "DDD":
                        objCommon.GetForm(new frmDangdoandoi(), this.panel3);
                        break;
                    case "DH":
                        objCommon.GetForm(new frmDanhhieu(), this.panel3);
                        break;
                    case "DT":
                        objCommon.GetForm(new frmDantoc(), this.panel3);
                        break;
                    case "DDG":
                        objCommon.GetForm(new frmDiemdanhgia(), this.panel3);
                        break;
                    case "DUD":
                        objCommon.GetForm(new frmDienuudai(), this.panel3);
                        break;
                    case "DUT":
                        objCommon.GetForm(new frmDienuutien(), this.panel3);
                        break;
                    case "DV":
                        objCommon.GetForm(new frmDonvi(), this.panel3);
                        break;
                    case "DTHS":
                        objCommon.GetForm(new frmDotuoihocsinh(), this.panel3);
                        break;
                    case "HT":
                        objCommon.GetForm(new frmHangtruong(), this.panel3);
                        break;
                    case "HK":
                        objCommon.GetForm(new frmHanhkiem(), this.panel3);
                        break;
                    case "HNN":
                        objCommon.GetForm(new frmHengoaingu(), this.panel3);
                        break;
                    case "HTGD":
                        objCommon.GetForm(new frmHethonggiaoduc(), this.panel3);
                        break;
                    case "HTKL":
                        objCommon.GetForm(new frmHinhthuckyluat(), this.panel3);
                        break;
                    case "HKNH":
                        objCommon.GetForm(new frmHocky(), this.panel3);
                        break;
                    case "HL":
                        objCommon.GetForm(new frmHocluc(), this.panel3);
                        break;
                    case "KL":
                        objCommon.GetForm(new frmKhoilop(), this.panel3);
                        break;
                    case "KT":
                        objCommon.GetForm(new frmKhuyettat(), this.panel3);
                        break;
                    default:
                        objCommon.GetForm(new frBuoihoc(), this.panel3);
                        break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
